1-2：显示所有课程信息

<%@ page import="cn.myschool.entity.Subject" %>
<%@ page import="java.util.List" %>
<%@ page import="cn.myschool.dao.SubjectDao" %>
<%@ page import="org.apache.ibatis.session.SqlSession" %>
<%@ page import="cn.myschool.util.MybatisUtil" %><%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2022/7/3
  Time: 21:49
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>课程信息</title>
</head>
<body>
<table border="1" cellpadding="0" cellspacing="0" align="center" style="width: 90%">
    <caption>课程信息</caption>
    <tr>
        <td>课程号</td>
        <td>课程名</td>
        <td>课时</td>
        <td>年级号</td>
    </tr>

    <%
        SqlSession sqlSession = MybatisUtil.get();
        SubjectDao mapper = sqlSession.getMapper(SubjectDao.class);
        List<Subject> list = mapper.findALL();
        for (Subject s : list) {
    %>
    <tr>
        <td><%=s.getId()%>
        </td>
        <td><%=s.getSubjectname()%>
        </td>
        <td><%=s.getClasshour()%>
        </td>
        <td><%=s.getGradeid()%>
        </td>
    </tr>
    <%}%>
</table>
</body>
</html>
